NetworkManager: <info> (ttyACM0): powering up... NetworkManager: <info> Registered on Home network an 15 10:50:04 blackadder NetworkManager: <info> Associated with network: +COPS: 0,2,"23415" NetworkManager: <WARN> dial_done(): Dialing timed out </WARN>Or:
NetworkManager: <info> Activation (ttyACM0) Stage 1 of 5 (Device Prepare) complete. NetworkManager: <info> (ttyACM0): powering up... NetworkManager: <info> Registered on Home network NetworkManager: <info> Associated with network: +COPS: 0,2,"23415" NetworkManager: <info> Connected, Woo! NetworkManager: <info> Activation (ttyACM0) Stage 2 of 5 (Device Configure) scheduled.. . NetworkManager: <info> Activation (ttyACM0) Stage 2 of 5 (Device Configure) starting... NetworkManager: <info> (ttyACM0): device state change: 4 -> 5 NetworkManager: <info> Starting pppd connection NetworkManager: <debug> [1232015456.962700] nm_ppp_manager_start(): Command line: /usr/s bin/pppd nodetach lock nodefaultroute user web ttyACM0 noipdefault usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/4 plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so NetworkManager: <debug> [1232015456.964964] nm_ppp_manager_start(): ppp started with pid 29590 NetworkManager: <info> Activation (ttyACM0) Stage 2 of 5 (Device Configure) complete. pppd[29590]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded. pppd[29590]: pppd 2.4.4 started by root, uid 0 NetworkManager: <WARN> pppd_timed_out(): Looks like pppd didn't initialize our dbus mod uleAnyone know what the problem could be?
Host *.local CheckHostIP noNow all machines I ssh into using a .local domain won't have their IP's key checked against the host key, because the IP is dynamic. Sorted! NP: Music Like Amon Tobin, Last.fm
import gobject, gnomekeyring # The keyring needs to know the application name if gobject.get_application_name() is None: gobject.set_application_name("offlineimap") def keyring(user, host): keys = gnomekeyring.find_network_password_sync(user=user, server=host, protocol="imap") # First one will do nicely thanks return keys[0]["password"] ... remotepasseval = keyring("rburton", "imapmail.intel.com")After writing a small tool to add the key to the keyring, to my surprise this worked first time. I bounced with glee, but ten minutes later I had error messages from OfflineIMAP running from cron in my inbox... GNOME Keyring uses an environment variable to find the daemon, which isn't set in a cron environment. GNOME Keyring will fall back to using DBus to find the daemon, but the DBus session bus environment variable isn't set. DBus will fall back to reading the session bus address from the X root window, but DISPLAY isn't set so that doesn't work either... EPIC FAIL. But, I thought, I upgraded to Network Manager 0.7 last week which bought in ConsoleKit. If I ask ConsoleKit for my sessions I should be able to find a session with has an X connection, then I can set DISPLAY appropriately and then the chain described above will work, and I'll have my password. Shockingly, this worked first time too:
import dbus, os if not os.getenv("DISPLAY"): # Get the ConsoleKit manager bus = dbus.SystemBus() manager_obj = bus.get_object('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Manager') manager = dbus.Interface(manager_obj, 'org.freedesktop.ConsoleKit.Manager') # For each of my sessions.. for ssid in manager.GetSessionsForUnixUser(os.getuid()): obj = bus.get_object('org.freedesktop.ConsoleKit', ssid) session = dbus.Interface(obj, 'org.freedesktop.ConsoleKit.Session') # Get the X11 display name dpy = session.GetX11Display() if dpy: # If we have a display, set the environment variable os.putenv("DISPLAY", dpy); break(man, I really with python-dbus had a better syntax for getting objects with a specific interface) So there you go, integrating OfflineIMAP with the GNOME Keyring via ConsoleKit and DBus. Surprisingly this was pretty easy to do, thanks to DBus and the magic provided by ConsoleKit it is 100% hack free.
"^(?<task>.+) (?:by due on)? (?<month>\\w+) (?<day>\\d 1,2 )(?:st nd rd th)?$"Apparently the average translator doesn't think that learning PCRE-style regular expressions, and reading the source that uses this string to understand how it is to be used, is appropriate. [note: this is sarcasm] Maybe I should have added some translator comments to clarify exactly what I meant by this. These monster strings (all in koto-date-parser.c) are GRegex regular expressions which are used to parse the user's input to try and extract meaningful date information. To translate these strings you'll need to have a basic understanding of regular expressions: if you don't then skip them and hopefully someone who does will finish the translation. If you know regular expressions then translating these strings is easy, honest. The golden rule is to never translate the words which look like this: (?<foo>. These are markers which identify portions of the input (such as task or month) and need to remain in English, although they can be moved around if required. The rest of the strings are translatable. I'll give an example using the French translation by Stéphane Raimbault. First, the string in English and a worked example:
"^(?<task>.+) (?:by due on)? (?<day>\\d 1,2 )(?:st nd rd th)? (?<month>\\w+)$"First, we have a sequence of any characters identified as task, which magically expands to be as many as possible. This is optionally followed by one of the words "by", "due" or "on". This is followed by one or two digits identified as day followed by "st", "nd", "rd" or "th". Finally a sequence of characters which is identified as month. If the user had entered "pay bills on 2nd june" then task would be "pay bills", day would be "2", and month would be "june". Tasks can then turn "june" into a month number through other translations, and it now knows what date the user entered. In French, this translates as follows:
"^(?<task>.+) (?:pour pr vu pour le)? (?<day>\\d 1,2 )(?:er e)? (?<month>\\w+)$"See, I said it was easy! All I need now is a legion of translators who understand regular expressions enough to correctly translate the new Tasks... [this, again, is sarcasm] Luckily, plans are afoot to move the Tasks source to the GNOME Subversion server, so the full fury of the GNOME translation team can attack this. NP: Trailer Park, Beth Orton
Next.